home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / initrd.lz / initrd / scripts / casper-bottom / 15autologin < prev    next >
Encoding:
Text File  |  2009-10-28  |  798 b   |  45 lines

  1. #!/bin/sh
  2.  
  3. PREREQ=""
  4. DESCRIPTION="Setting up automatic login..."
  5.  
  6. . /scripts/casper-functions
  7.  
  8. prereqs()
  9. {
  10.        echo "$PREREQ"
  11. }
  12.  
  13. case $1 in
  14. # get pre-requisites
  15. prereqs)
  16.        prereqs
  17.        exit 0
  18.        ;;
  19. esac
  20.  
  21. log_begin_msg "$DESCRIPTION"
  22.  
  23. if [ -d /root/etc/gdm ]; then
  24.     # Configure GDM autologin
  25.     cat > /root/etc/gdm/custom.conf <<EOF
  26. [daemon]
  27. AutomaticLoginEnable=true
  28. AutomaticLogin=$USERNAME
  29. TimedLoginEnable=true
  30. TimedLogin=$USERNAME
  31. TimedLoginDelay=10
  32. EOF
  33. fi
  34.  
  35. if [ -f /root/etc/kde4/kdm/kdmrc ]; then
  36.     # Configure KDM autologin
  37.     sed -i -r \
  38.         -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
  39.         -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
  40.         -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
  41.         /root/etc/kde4/kdm/kdmrc
  42. fi
  43.  
  44. log_end_msg
  45.